package org.tourism.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.tourism.entity.HotelReview;
import org.tourism.mapper.HotelReviewMapper;
import org.tourism.service.HotelReviewService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wuling
 * @since 2024-07-05
 */
@Service
public class HotelReviewServiceImpl extends ServiceImpl<HotelReviewMapper, HotelReview> implements HotelReviewService {
    @Autowired
    private HotelReviewMapper hotelReviewMapper;
    @Override
    public int insertHotelReview(HotelReview hotelReview) {
        return hotelReviewMapper.insert(hotelReview);
    }

    @Override
    public int updateHotelReview(HotelReview hotelReview) {
        return hotelReviewMapper.updateById(hotelReview);
    }

    @Override
    public int deleteHotelReview(HotelReview hotelReview) {
        return hotelReviewMapper.deleteById(hotelReview.getId());
    }

    @Override
    public HotelReview selectHotelReviewById(Long id) {
        return hotelReviewMapper.selectById(id);
    }

    @Override
    public List<HotelReview> selectHotelReviewByHotelId(Long hotelId) {
        return hotelReviewMapper.selectList(null);
    }
}
